<?php

/**
 * Performance filter form base class.
 *
 * @package    gamerstats
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasePerformanceFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'user'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => true)),
      'round'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Round'), 'add_empty' => true)),
      'stat1'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'stat2'  => new sfWidgetFormFilterInput(),
      'stat3'  => new sfWidgetFormFilterInput(),
      'stat4'  => new sfWidgetFormFilterInput(),
      'stat5'  => new sfWidgetFormFilterInput(),
      'stat6'  => new sfWidgetFormFilterInput(),
      'stat7'  => new sfWidgetFormFilterInput(),
      'stat8'  => new sfWidgetFormFilterInput(),
      'stat9'  => new sfWidgetFormFilterInput(),
      'stat10' => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'user'   => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('User'), 'column' => 'id')),
      'round'  => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Round'), 'column' => 'id')),
      'stat1'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat2'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat3'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat4'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat5'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat6'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat7'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat8'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat9'  => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'stat10' => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('performance_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Performance';
  }

  public function getFields()
  {
    return array(
      'id'     => 'Number',
      'user'   => 'ForeignKey',
      'round'  => 'ForeignKey',
      'stat1'  => 'Number',
      'stat2'  => 'Number',
      'stat3'  => 'Number',
      'stat4'  => 'Number',
      'stat5'  => 'Number',
      'stat6'  => 'Number',
      'stat7'  => 'Number',
      'stat8'  => 'Number',
      'stat9'  => 'Number',
      'stat10' => 'Number',
    );
  }
}
